<script charset="utf-8" src="<?=base_url()?>resource/plugins/kindeditor/kindeditor.js"></script>
<script charset="utf-8" src="<?=base_url()?>resource/plugins/kindeditor/lang/<?=$curLang=='en'?'en':'zh_CN';?>.js"></script>

<script type="application/javascript">
    function myform_submit() {

        return true;
    }
    KindEditor.ready(function(K) {
        window.editor = K.create('.editor_id',{
            resizeType : 1,
            allowPreviewEmoticons : false,
            allowImageUpload : true,
            width : '100%',
            Height : '250px',
            langType : '<?=$curLang=='en'?'en':'zh_CN';?>',
            items : [
                'forecolor', 'hilitecolor','formatblock','bold','|', 'image', 'link']
        });
    });
</script>

<style type="text/css">
    .contentFormat{
        width:400px; max-height: 350px; text-align: left;display:inline;
    }
    .contentFormat img{
        width:100px; max-height: 250px;
        vertical-align: middle;
    }
</style>
<!--菜单 start-->
<?php $this->load->view('defaults/common/left');?>
<!--菜单 end-->
<div id="content">
    <div class="page-header">
        <div class="container-fluid">
        <h1><?=lang('product_bjcpxx')?></h1>
        <?=$this->breadcrumb->generateHTML();?>
        </div>
    </div>
    <div class="container-fluid">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title"><i class="fa fa-pencil"></i><?=lang('product_bjcpxx')?></h3>
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table class="style20170608" cellspacing="0">
                      <tbody>
                        <tr>
                            <td class="tableSubtitle odd"><?=lang('order_wxdh')?></td>
                            <td class="tableContent"><?=$productFirst['order_num']?></td>                                               
                            <td class="tableSubtitle odd"><?=lang('order_wxlx')?></td>
                            <td class="tableContent"><?=$productFirst['serviceTypeName']?></td>
                        </tr>
                        <tr>
                            <td class="tableSubtitle even"><?=lang('order_lydh')?></td>
                            <td class="tableContent"><?=$productFirst['source_id_order']?></td>                                                            
                            <td class="tableSubtitle even"><?=lang('product_cplx')?></td>
                            <td class="tableContent"><?=$productFirst['category_name']?></td>
                        </tr>
                        <tr>
                            <td class="tableSubtitle odd">SKU</td>
                            <td class="tableContent"><?=$productFirst['productSku']?></td>                                                            
                            <td class="tableSubtitle odd">IMEI</td>
                            <td class="tableContent"><?=$productFirst['imei']?></td>
                        </tr>
                        <tr>
                            <td class="tableSubtitle even">brand</td>
                            <td class="tableContent"><?=$productFirst['product_brand']?></td>                                                            
                            <td class="tableSubtitle even">model</td>
                            <td class="tableContent"><?=$productFirst['product_model']?></td>
                        </tr>
                        <tr>
                            <td class="tableSubtitle odd"><?=lang('order_zt')?></td>
                            <td class="tableContent"><?=$productFirst['statusName']?></td>
                            <td class="tableSubtitle odd"><?=lang('product_ppkhbh')?></td>
                            <td class="tableContent"><?=$brandCustomer['id']?></td>                                                           
                        </tr>
                         <tr>
                            <td class="tableSubtitle even"><?=lang('product_ppkhmc')?></td>
                            <td class="tableContent"><?=$brandCustomer['name']?></td> 
                            <td class="tableSubtitle even"><?=lang('product_gzms')?></td>
                            <td class="tableContent"><?=$productFirst['defectDes']?></td>                                                                   
                        </tr>
                        <tr>
                            <td class="tableSubtitle odd"><?=lang('product_khbz')?></td>
                            <td class="tableContent" colspan="3">
                             <?=$productFirst['customerRemark']?>
                            </td>                                                         
                        </tr>
                        <tr>
                            <td class="tableSubtitle even"><?=lang('product_cbbz')?></td>
                            <td class="tableContent"><?=$productFirst['csRemark']?></td>                                                            
                            <td class="tableSubtitle even"><?=lang('product_wxsbz')?></td>
                            <td class="tableContent"><?=$productFirst['technicianRemark']?></td>
                        </tr>
                        <tr>
                            <td class="tableSubtitle odd"><?=lang('product_zjbz')?></td>
                            <td class="tableContent" colspan="3"><?=$productFirst['exitQC']?></td>
                        </tr>
                      </tbody>
                    </table>
                    <?php if($logList):?>
                    <h3 class="panel-title" style="margin: 15px 0 10px 0;"><?=lang('product_gxrz')?></h3>
                    <table class="table table-bordered table-hover oms-table">
                        <thead>
                        <tr>
                            <th class="text-left">id</th>
                            <th class="text-left" style="width:60%;"><?=lang('product_gxnr')?></th>
                            <th class="text-right"><?=lang('order_clr')?></th>
                            <th class="text-right"><?=lang('order_rq')?></th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php foreach ($logList as $key=>$rs):?>
                            <tr>
                                <td class="text-left"><?=$rs['id']?></td>
                                <td class="text-left">
                                    <div class="contentFormat">
                                        <?=$rs['contentFormat']?>
                                    </div>
                                </td>
                                <td class="text-right"><?=$rs['add_user']?></td>
                                <td class="text-right"><?=$rs['add_time']?></td>
                            </tr>
                        <?php endforeach;?>
                        </tbody>
                    </table>
                    <?php endif; ?>
                    <div id="contents_container" style="margin-top: 10px;overflow: hidden;">
                        <form action="<?=blang_url('products/Product_new/'.$post_type)?>" method="post" class="form-horizontal" name="myform" onsubmit="return myform_submit()" autocomplete="off" >
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?=lang('product_cpzt')?></label>
                                <div class="col-sm-10">
                                    <label class="oms-radio">
                                        <input type="radio" name="available" value="0" <?=$ckdAvailable['0']?>/>failed
                                    </label>
                                    <label class="oms-radio">
                                        <input type="radio" name="available" value="1"  <?=$ckdAvailable['1']?> />normal
                                    </label>
                                    <label class="oms-radio">
                                       <input type="radio" name="available" value="2"  <?=$ckdAvailable['2']?> />hold
                                    </label>
                                </div>
                            </div>
                             <?php
                                $arr_u = unserialize($this->users['role_details']);
                                //一些特殊的权限需要专门针对用户配置，所以用户表增加 role_details 字段，以数组的形式保存特殊的一些状态
                                if (in_array('1' , $role_id) || in_array('10' , $role_id)|| in_array('5' , $role_id) || (!empty($arr_u['product_new_edit_status']))): ?>
                                <?php if(in_array('5' , $role_id)): if($productFirst['status_id']==8):?>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?=lang('order_zt')?></label>
                                <div class="col-sm-10">
                                    <select class="form-control" name="status_id" id="statusID">
                                        <?php foreach ($statusList as $rs):?>
                                            <option value="<?=$rs['id']?>" <?=$optStatus[$rs['id']]?> >
                                                <?=$rs['name_'.$curLang]?>
                                            </option>
                                        <?php endforeach;?>
                                    </select>
                                </div>
                            </div>
                            <?php endif; 
                            else: ?>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?=lang('order_zt')?></label>
                                <div class="col-sm-10">
                                    <select class="form-control" name="status_id" id="statusID">
                                        <?php foreach ($statusList as $rs):?>
                                            <option value="<?=$rs['id']?>" <?=$optStatus[$rs['id']]?> >
                                                <?=$rs['name_'.$curLang]?>
                                            </option>
                                        <?php endforeach;?>
                                    </select>
                                </div>
                            </div>
                            <?php endif; endif;?>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><?=lang('product_qtbz')?></label>
                                <div class="col-sm-10">
                                    <textarea name="otherRemark" class="editor_id" ></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"></label>
                                <div class="col-sm-10">
                                    <input name="id" type="hidden" value="<?=$productFirst['id']?>" />
                                    <input type="submit" class="btn btn-primary" style="padding:8px 45px;" value="<?=lang('public_tj')?>" name="submits" />
                                </div>
                            </div>
                            
                        </form>
                       </div>
                    
                </div>
            </div>
        </div>
    </div>

    
</div>
